package com.hinnotek.amoeba.viewmodels


import androidx.lifecycle.viewModelScope
import com.hinnotek.amoeba.bean.old.SysPersonListBean
import com.hinnotek.amoeba.repo.SysPersonRepo
import com.lee.common.base.BaseViewModel
import com.lee.common.network.net.StateLiveData
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class SysPersonViewModel @Inject constructor(private val repo: SysPersonRepo) :
    BaseViewModel() {

    val sysPersonData = StateLiveData<MutableList<SysPersonListBean>>()

    fun getSysPersonList(): StateLiveData<MutableList<SysPersonListBean>> {
        viewModelScope.launch {
            repo.getSysPersonList(sysPersonData)
        }
        return sysPersonData
    }

}